/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.entityBeans;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "T_MODELOS_ARTICULOS")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TModelosArticulos.findAll", query = "SELECT t FROM TModelosArticulos t"),
    @NamedQuery(name = "TModelosArticulos.findByNIdModeloArticuloPk", query = "SELECT t FROM TModelosArticulos t WHERE t.nIdModeloArticuloPk = :nIdModeloArticuloPk"),
    @NamedQuery(name = "TModelosArticulos.findByVDescripcionModelo", query = "SELECT t FROM TModelosArticulos t WHERE t.vDescripcionModelo = :vDescripcionModelo")})
public class TModelosArticulos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_MODELO_ARTICULO_PK")
    private Integer nIdModeloArticuloPk;
    @Basic(optional = false)
    @Column(name = "V_DESCRIPCION_MODELO")
    private String vDescripcionModelo;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "nIdModeloVehiculoGFk")
    private List<TVehiculosGeneral> tVehiculosGeneralList;
    @JoinColumn(name = "N_ID_SUBCATEGORIA_ARTICULO_FK", referencedColumnName = "N_ID_SUBCATEGORIA_ARTICULO_PK")
    @ManyToOne(optional = false)
    private TSubcategoriaArticulos nIdSubcategoriaArticuloFk;
    @JoinColumn(name = "N_ID_MARCA_ARTICULO_FK", referencedColumnName = "N_ID_MARCA_ARTICULO_PK")
    @ManyToOne(optional = false)
    private TMarcasArticulos nIdMarcaArticuloFk;

    public TModelosArticulos() {
    }

    public TModelosArticulos(Integer nIdModeloArticuloPk) {
        this.nIdModeloArticuloPk = nIdModeloArticuloPk;
    }

    public TModelosArticulos(Integer nIdModeloArticuloPk, String vDescripcionModelo) {
        this.nIdModeloArticuloPk = nIdModeloArticuloPk;
        this.vDescripcionModelo = vDescripcionModelo;
    }

    public Integer getNIdModeloArticuloPk() {
        return nIdModeloArticuloPk;
    }

    public void setNIdModeloArticuloPk(Integer nIdModeloArticuloPk) {
        this.nIdModeloArticuloPk = nIdModeloArticuloPk;
    }

    public String getVDescripcionModelo() {
        return vDescripcionModelo;
    }

    public void setVDescripcionModelo(String vDescripcionModelo) {
        this.vDescripcionModelo = vDescripcionModelo;
    }

    @XmlTransient
    public List<TVehiculosGeneral> getTVehiculosGeneralList() {
        return tVehiculosGeneralList;
    }

    public void setTVehiculosGeneralList(List<TVehiculosGeneral> tVehiculosGeneralList) {
        this.tVehiculosGeneralList = tVehiculosGeneralList;
    }

    public TSubcategoriaArticulos getNIdSubcategoriaArticuloFk() {
        return nIdSubcategoriaArticuloFk;
    }

    public void setNIdSubcategoriaArticuloFk(TSubcategoriaArticulos nIdSubcategoriaArticuloFk) {
        this.nIdSubcategoriaArticuloFk = nIdSubcategoriaArticuloFk;
    }

    public TMarcasArticulos getNIdMarcaArticuloFk() {
        return nIdMarcaArticuloFk;
    }

    public void setNIdMarcaArticuloFk(TMarcasArticulos nIdMarcaArticuloFk) {
        this.nIdMarcaArticuloFk = nIdMarcaArticuloFk;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdModeloArticuloPk != null ? nIdModeloArticuloPk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TModelosArticulos)) {
            return false;
        }
        TModelosArticulos other = (TModelosArticulos) object;
        if ((this.nIdModeloArticuloPk == null && other.nIdModeloArticuloPk != null) || (this.nIdModeloArticuloPk != null && !this.nIdModeloArticuloPk.equals(other.nIdModeloArticuloPk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TModelosArticulos[ nIdModeloArticuloPk=" + nIdModeloArticuloPk + " ]";
    }
    
}
